package com.isoft.airportsystem.mapper.change;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.isoft.airportsystem.entity.change.FlightChangeRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
@Mapper

public interface FlightChangeRequestMapper extends BaseMapper<FlightChangeRequest> {   // 航班变更请求
    // 自定义查询方法
    @Select("SELECT * FROM FLIGHT_CHANGE_REQUEST WHERE FLIGHT_ID = #{flightId} AND REQUEST_STATUS = #{status}")
    List<FlightChangeRequest> findByFlightIdAndStatus(@Param("flightId") String flightId,
                                                      @Param("status") String status);

    // 分页查询
    IPage<FlightChangeRequest> selectPageByCondition(Page<FlightChangeRequest> page,
                                                     @Param("flightId") String flightId,
                                                     @Param("status") String status);
}

